package com.yunhe.common.model.base;

import com.yunhe.common.model.authority.StationDTO;
import com.yunhe.common.model.device.DeviceDTO;

import java.util.List;

/**
 * 异常规则
 * @author liuronglei
 */
public class AlarmRuleDTO {
    private Long id;
    /**
     * 异常类型标题
     */
    private String title;
    /**
     * 异常类型详情
     */
    private String desc;
    /**
     * 适用范围
     */
    private AlarmScopeDTO alarmScope;
    /**
     * 异常类型
     */
    private AlarmTypeDTO alarmType;
    /**
     * 异常级别
     */
    private AlarmLevelDTO alarmLevel;
    /**
     * 异常判断类型
     */
    private AlarmCalcTypeDTO alarmCalcType;
    /**
     * 电站类型
     */
    private StationTypeDTO stationType;
    /**
     * 是否全部电站
     */
    private Boolean isAllStation;
    /**
     * 适用电站
     */
    private List<StationDTO> stations;
    /**
     * 设备类型
     */
    private DeviceTypeDTO deviceType;
    /**
     * 是否全部设备
     */
    private Boolean isAllDevice;
    /**
     * 适用设备
     */
    private List<DeviceDTO> devices;
    /**
     * 公式
     */
    private String formula;
    /**
     * 公式中用于计算的点号数据类型
     */
    private List<PointDataTypeDTO> pointDataTypes;
    /**
     * 关联的点号数据类型
     */
    private List<PointDataTypeDTO> relatedPointDataTypes;
    /**
     * 持续时间_时间戳
     */
    private Long durationRtime;
    /**
     * 维护时间_字符串
     */
    private String dtime;
    /**
     * 维护时间_时间戳
     */
    private Long rtime;
    /**
     * 维护人ID
     */
    private Long userId;
    /**
     * 维护人
     */
    private String userTitle;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getTitle() {
        return title == null ? (alarmType == null ? null : alarmType.getTitle()) : title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public AlarmScopeDTO getAlarmScope() {
        return alarmScope;
    }

    public void setAlarmScope(AlarmScopeDTO alarmScope) {
        this.alarmScope = alarmScope;
    }

    public AlarmTypeDTO getAlarmType() {
        return alarmType;
    }

    public void setAlarmType(AlarmTypeDTO alarmType) {
        this.alarmType = alarmType;
    }

    public AlarmLevelDTO getAlarmLevel() {
        return alarmLevel;
    }

    public void setAlarmLevel(AlarmLevelDTO alarmLevel) {
        this.alarmLevel = alarmLevel;
    }

    public AlarmCalcTypeDTO getAlarmCalcType() {
        return alarmCalcType;
    }

    public void setAlarmCalcType(AlarmCalcTypeDTO alarmCalcType) {
        this.alarmCalcType = alarmCalcType;
    }

    public StationTypeDTO getStationType() {
        return stationType;
    }

    public void setStationType(StationTypeDTO stationType) {
        this.stationType = stationType;
    }

    public List<StationDTO> getStations() {
        return stations;
    }

    public void setStations(List<StationDTO> stations) {
        this.stations = stations;
    }

    public DeviceTypeDTO getDeviceType() {
        return deviceType;
    }

    public void setDeviceType(DeviceTypeDTO deviceType) {
        this.deviceType = deviceType;
    }

    public List<DeviceDTO> getDevices() {
        return devices;
    }

    public void setDevices(List<DeviceDTO> devices) {
        this.devices = devices;
    }

    public String getFormula() {
        return formula;
    }

    public void setFormula(String formula) {
        this.formula = formula;
    }

    public List<PointDataTypeDTO> getPointDataTypes() {
        return pointDataTypes;
    }

    public void setPointDataTypes(List<PointDataTypeDTO> pointDataTypes) {
        this.pointDataTypes = pointDataTypes;
    }

    public List<PointDataTypeDTO> getRelatedPointDataTypes() {
        return relatedPointDataTypes;
    }

    public void setRelatedPointDataTypes(List<PointDataTypeDTO> relatedPointDataTypes) {
        this.relatedPointDataTypes = relatedPointDataTypes;
    }

    public String getDtime() {
        return dtime;
    }

    public void setDtime(String dtime) {
        this.dtime = dtime;
    }

    public Long getRtime() {
        return rtime;
    }

    public void setRtime(Long rtime) {
        this.rtime = rtime;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getUserTitle() {
        return userTitle;
    }

    public void setUserTitle(String userTitle) {
        this.userTitle = userTitle;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public Long getDurationRtime() {
        return durationRtime;
    }

    public void setDurationRtime(Long durationRtime) {
        this.durationRtime = durationRtime;
    }

    public Boolean getIsAllStation() {
        return isAllStation == null ? false : isAllStation;
    }

    public void setIsAllStation(Boolean isAllStation) {
        this.isAllStation = isAllStation;
    }

    public Boolean getIsAllDevice() {
        return isAllDevice == null ? false : isAllDevice;
    }

    public void setIsAllDevice(Boolean isAllDevice) {
        this.isAllDevice = isAllDevice;
    }
}